import 'bootstrap/dist/css/bootstrap.css';
import '../css/style.scss';
import {log} from './urlconfig/config.js';
$('.nav-all a[href="question.html"]').addClass('active');
require('./common.js');
var Fingerprint = require('./fingerprint.js');
var token;
var cpuid = new Fingerprint().get();
var edition='web_1.5.1.2';
var channel;
var sys='Window10';
if(localStorage.token != null){
    token=localStorage.token
}

var main=$("#fagepage").val();
function GetUrlParam(paraName) {
    var url = document.location.toString();
    var arrObj = url.split("?");

    if (arrObj.length > 1) {
        var arrPara = arrObj[1].split("&");
        var arr;

        for (var i = 0; i < arrPara.length; i++) {
            arr = arrPara[i].split("=");

            if (arr != null && arr[0] == paraName) {
                return arr[1];
            }
        }
        return "";
    }
    else {
        return "";
    }
};
(function (){
    var url = document.location.toString();
    if (url.indexOf("?") != -1) {
        channel=GetUrlParam("c_code");
        localStorage.setItem("channel",channel);
    }else{
        if(localStorage.channel !=null){
            channel=localStorage.getItem("channel");
        }else{
            channel='plat_a01';
        }
    }
})();
$.ajax({
    type:'GET',
    url:log+ main+'/'+'pageShow' +'/'+ channel+'/'+ edition + '/'+sys + '/'+cpuid,
    dataType: 'json',
    success:function(res) {
        if(res.code==200){

        }
    },
    error:function(err) {

    }
});
$(".swiper-slide a").click(function(){
    var btn=$(this).attr("data-log");
    $.ajax({
        type:'GET',
        url:log+main+'/'+ btn +'/'+ channel+'/'+ edition + '/'+cpuid,
        dataType: 'json',
        success:function(res) {
            if(res.code==200){

            }
        },
        error:function() {


        }
    })
});
require('./model.js');